include_directories (${qia_SOURCE_DIR}/include)

link_directories (${qia_BINARY_DIR}/libs)

file (GLOB HEADER_FILES *.h)
file (GLOB CPP_FILES *.cpp)
file (GLOB QRC_FILES ../resources.qrc)

qt4_add_resources(RCC_FILES ${QRC_FILES})
qt4_wrap_cpp (MOC_FILES ${HEADER_FILES})
qt4_automoc (${CPP_FILES})

#add_dependencies (qia resources)

add_executable (qia ${HEADER_FILES} ${CPP_FILES} ${MOC_FILES} ${RCC_FILES})

if (WIN32)
target_link_libraries (qia ia_auth_c common blowfish "C:\\Program Files\\GnuWin32\\lib\\libiconv.a" ${QT_LIBRARIES})
else (WIN32)
target_link_libraries (qia ia_auth_c common blowfish ${QT_LIBRARIES})
endif (WIN32)

install (TARGETS qia RUNTIME DESTINATION bin)

if (WIN32)
    set (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
endif (WIN32)

if (UNIX AND NOT APPLE)
    install (FILES qia.desktop DESTINATION share/applications)
endif (UNIX AND NOT APPLE)
